package org.exhaust.framework.net.test.protocol.client.tcp.client;

import io.netty.buffer.ByteBuf;
import org.exhaust.framework.net.test.protocol.util.ByteUtils;

public class LoginRequest extends ClientGprsMsg {

    private String id;

    public LoginRequest(String id) {
        this.id = id;
    }

    @Override
    protected void encodeData(ByteBuf out) {
        out.writeByte(0xAA);
        out.writeByte(0x55);
        out.writeBytes(ByteUtils.str2Bcd(ByteUtils.patchLength2Zero(id, 12)));
        out.writeByte(0x44);
        out.writeByte(0x55);
        out.writeByte(0x66);
        out.writeByte(0x33);
        out.writeByte(0xCC);
    }

}
